package caraosello;

import javax.swing.JOptionPane;
public class caraosello {
	
	public static void main(String[] args) {
        
	    int N = Integer.parseInt(JOptionPane.showInputDialog(null,"ingrese el numero de juegos"));
	        int i = 0;
	        int j = 0;
	        int k = 0;
	  System.out.println("cantidad de juegos = "+N);
	    
	    do{
	       
	        int Ri= Integer.parseInt(JOptionPane.showInputDialog(null,"ingrese 0 si hana si gana mary"
	                + "ingrese 1 si gana jhon"));
	        i++;
	            System.out.println(Ri);
	           if (Ri==0){
	               j++;
	           }
	           if (Ri==1){    
	               k++;
	           }
	            
	   }while (i<N);
	    System.out.println("mary win "+j+" veces");
	            System.out.println("jhon win "+k+ "veces");
	}

}
